﻿#ifndef VIRTUALDEVICE_H
#define VIRTUALDEVICE_H

#include <QObject>
#include <QTcpSocket>
#include "device.h"
#include "description.h"
#include <QJsonObject>

class VirtualDevice : public Device
{
    Q_OBJECT
public:
    explicit VirtualDevice(QObject *parent = nullptr);
    ~VirtualDevice();

private:
    Description*    m_pDescription;

public:
    void            SetDescription(Description* pDescription){m_pDescription = pDescription;}
    Description*    GetDescription(){return m_pDescription;}

signals:
    void SendCmdToVirtualDevice(QVariant variant);

public:
    virtual Device* clone(Device* pDevice) override;
    virtual void writeXML(QXmlStreamWriter &writer) override;
    virtual void readFromXML(QXmlStreamReader &reader) override;

    virtual int initDevice() override;
    virtual void writeData(const QVariant &data) override;
    virtual void uninitDevice() override;
    virtual QString getClassName() override;
};

#endif // VIRTUALDEVICE_H
